package qsoft.omanga.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.Gallery;

import java.util.List;

import qsoft.omanga.ui.adapter.ImageAdapter;

import qsoft.omanga.business.component.MangaBusiness;
import qsoft.omanga.business.entities.Manga;

/**
 * 
 * @author sontt
 *
 */
public class GalleryImagesMangaActivity extends Activity {

	private Gallery gallery;
	private MangaBusiness mangaBusiness;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.gallery_image_manga);
		gallery = (Gallery) findViewById(R.id.galleryImage);
		mangaBusiness = new MangaBusiness(this.getApplicationContext());
		List<Manga> listMangas = mangaBusiness.getListNewFromService();
		gallery.setAdapter(new ImageAdapter(this.getApplicationContext(), listMangas));
		gallery.setOnItemSelectedListener(new OnItemSelectedListener() {
			public void onItemSelected(AdapterView<?> parent, View v,
					int position, long id) {
				
			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
				
			}
		});
	}

}
